feat: cache sessions for multiple users #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #25
Serve encrypted sessions directly from an in-memory cache, performing a full login when necessary on a cache miss. This should happen only once for each user in a test run, alleviating some pressure on the Auth0 API, particularly in CI environments where multiple copies of the suite may run in parallel.
How to test
The Cypress terminal window will output http logs indicating that a programmatic login has occurred:
I simply ran my Cypress suite of 40 tests against both this branch and
main
, and counted how many times these log entries appeared. Onmain
, I saw 22 instances. On this branch, I saw 9 -- one for each user in the test suite -- without any loss in functionality.One thing to note: if any test updates the Cypress superdomain, it seems that the Cypress window is reset and the cache is lost. I'm curious if there's another way to store the cache such that it persists across superdomain updates.